package com.example.gugongticket.dao;

import com.example.gugongticket.entity.Orders;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;


public interface OrdersRepository extends JpaRepository<Orders, Integer> {
    // 使用@Query注解自定义查询语句
    @Query("SELECT o FROM Orders o WHERE o.userId = :userId")
    List<Orders> findByUserid(int userId);



}